using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace TripleMatch
{
    public class GameDefine : MonoBehaviour
    {
        private static GameDefine s;
        public static GameDefine S
        {
            get { return s;}
        }

        private void Awake()
        {
            s = this;
        }

        [SerializeField] public LevelObj levelObjPrefabs;
        [SerializeField] public AudioClip[] gameSounds;
        [SerializeField] public DecorationsData decorationDatas;

        public const string SaveKey_CurrentLevel = "SaveKey_CurrentLevel";
        public const string SaveKey_CurrentDifficulty = "SaveKey_CurrentDifficulty";
        public const string SaveKey_AudioState = "SaveKey_AudioState";
        public const string SaveKey_DecorationData = "SaveKey_DecorationData";

        public int Data_LevelLimitCount = 7;
        public int Data_LevelBonusCount = 6;
        public int Data_CubeSize = 120;

        public int[] Data_QualityTransRate = new int[4] { 0, 20, 40, 80 };
        public int[] Data_TypeTransRate = new int[4] { 1, 30, 10, 20 };

        public static LevelConfigData guideDifficultData = new LevelConfigData()
        {
            totalCount = 9,
            totalLayer = 1,
            levelSpriteCount = 3
        };

        public static LevelConfigData easyDifficultData = new LevelConfigData()
        {
            totalCount = 42, 
            totalLayer = 2,
            levelSpriteCount = 7
        };

        public static LevelConfigData standardDifficultData = new LevelConfigData()
        {
            totalCount = 63,
            totalLayer = 3,
            levelSpriteCount = 8
        };

        public static LevelConfigData hardDifficultData = new LevelConfigData()
        {
            totalCount = 96,
            totalLayer = 4,
            levelSpriteCount = 12
        };

        public AudioClip GetAudioClip(GameSound gameSound)
        {
            int index = (int)gameSound;
            if (gameSounds.Length > index) return gameSounds[index];
            else return null;
        }
    }

    /// <summary>
    /// 难度系数
    /// </summary>
    public struct LevelConfigData
    {
        public int totalCount;
        public int totalLayer;
        public int levelSpriteCount; //不使用这个数值 纯随机看看
    }

    public enum ShapeType
    {
        Square,         //方形   
        Heart,          //心形    
        Circle,         //圆形
        Slide,          //边框
        ShapeLast
    }

    public enum GradientType
    {
        Decrease,       //递减
        Increase,       //递增
        Fusiform,       //梭形
        SameSize,       //平移
        GradientLast    //随机
    }

    public enum StandardDifficulty
    {
        Easy,
        Standard,
        Hard,
    }

    public enum GameSound
    {

    }
}

